<?php
namespace appin\cms\model;

use appin\cms\Model;
use think\model\concern\SoftDelete;

class Pos extends Model
{
    use SoftDelete;

    protected $name = 'cms_pos';
    protected $autoWriteTimestamp = true;
    protected $deleteTime = 'delete_time';

    /**
     * @param $query
     * @param $keyword
     */
    public function scopeUseKeyword($query, $keyword)
    {
        if (!empty($keyword)) {
            $query->where('title', 'LIKE', '%'.$keyword . '%');
        }
    }
}